<template>
	<view class="container">
		<view class="top">
			<view class="head">
				<image :src="info.avatar" class="ren"></image>
			</view>
			<view class="jie">
				<view class="name">{{info.nickName}}<text>{{info.remark}}</text></view>
				<view class="tel">{{info.phonenumber}}<text>部门：{{info.dept.deptName}}</text></view>
			</view>
		</view>
		<view class="my">
			<view class="mys">
				<view class="myss" @click="sao">
					<image src="../../../static/images/sao.png" mode=""></image>
					<text>扫一扫</text>
				</view>
				<view class="myss" @click="myMessage">
					<image src="../../../static/images/xi.png" mode=""></image>
					<text>我的消息</text>
				</view>
				<view class="myss" @click="password">
					<image src="../../../static/images/gai.png" mode=""></image>
					<text>修改密码</text>
				</view>
				<view class="myss" @click="toLogin">
					<image src="../../../static/images/tui.png" mode=""></image>
					<text>退出登录</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info:{},
				// mys: [
				// 	{
				// 		icon: require('../../../static/images/sao.png'),
				// 		text:'扫一扫'
				// 	},
				//     {
				// 		icon: require('../../../static/images/xi.png'),
				// 		text:'我的消息'
				// 	},
				// 	{
				// 		icon: require('../../../static/images/gai.png'),
				// 		text:'修改密码'
				// 	},
				// 	{
				// 		icon: require('../../../static/images/tui.png'),
				// 		text:'退出登录'
				// 	},
				// ],
			}
		},
		onLoad() {
			this.urser()
		},
		methods: {
			password(){
				uni.reLaunch({
					url:'passwork'
				})
			},
			urser(){
				uni.request({
				     url: this.$url + 'getInfo',
				     method: 'GET',
					 header:{
					       'Authorization': 'Bearer ' + uni.getStorageSync("token")
					      },
				     success: (res) => {
				        console.log(res);
						if(res.data.code==200){
							this.info=res.data.data.userInfo
						}
						console.log(this.info)
				     },
				     complete: () => {
				      
				     },
				     fail: (e) => {
				      console.log(e);
				     }
				});
			},
			toLogin(){
				uni.clearStorage();
				uni.redirectTo({
					url:'../login'
				})
			}
		}
	}
</script>

<style lang="scss">
    .container{
		.top{
			background-color:#3472FD;
			display:flex;
			// justify-content:space-around;
			padding: 30rpx 40rpx;
			align-items: center;
			padding-bottom: 90rpx;
			.ren{
				width: 111rpx;
				height: 111rpx;
			}
			.jie{
				color: #fff;
				font-size:32rpx;
				line-height:40rpx;
				margin-left:50rpx;
				.name{
					line-height: 40rpx;
					font-size: 36rpx !important;
					text{
						display: inline-block;
						width:100rpx;
						line-height: 40rpx;
						font-size:32rpx !important;
						text-align: center;
						background-color: #fff;
						border-radius: 4px;
						color: #2571F6 !important;
						margin-left:30rpx;
					}
				}
				.tel{
					margin-top: 20rpx;
					text{
						margin-left: 15rpx;
					}
				}
			}
		}
		.my{
			background-color: #fff;
			border-top-left-radius: 60rpx;
			border-top-right-radius: 60rpx;
			margin-top:-70rpx;
			padding:30rpx 40rpx;
			.myss{
				line-height: 90rpx;
				vertical-align: middle;
				border-bottom: 1px solid #F2F2F2;
				padding-left: 25rpx;
				image{
					width: 36rpx;
					height: 36rpx;
					vertical-align: middle;
				}
				text{
					font-size:34rpx;
					margin-left: 35rpx;
				}
			}
		}
	}
</style>
